package net.thetabx.ftdba;

import net.thetabx.ftdba.http.DefaultHttpManager;
import net.thetabx.ftdba.http.HttpManager;
import net.thetabx.ftdba.http.ProxifiedHttpManager;
import android.app.Application;
import android.content.Context;

public class GlobalData extends Application {
	private static Context mContext;
	private static HttpManager http;
	
	@Override
    public void onCreate() {
        super.onCreate();
        mContext = this;
        http = newHttpManager(true);
    }
	
	public static Context getContext(){
        return mContext;
    }
	
	public static HttpManager getHttpManager() {
		return http;
	}
	
	public static HttpManager newHttpManager(Boolean proxy) {
		if(proxy)
			http = new ProxifiedHttpManager();
		else
			http = new DefaultHttpManager();
		return http;
	}
}
